package com.example.manage_dzensaas.filter.exception;

import com.example.manage_dzensaas.core.enums.ErrorCodeEnum;

public class CustomException extends RuntimeException {
    private final int code;

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
    }

    public CustomException(String message) {
        super(message);
        this.code = ErrorCodeEnum.CUSTOM_EXCEPTION.getCode();
    }

    public CustomException(ErrorCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getMessage());
        this.code = errorCodeEnum.getCode();
    }

    public int getCode() {
        return code;
    }
}
